package ru.pachkun.home.block;

import org.openqa.selenium.support.FindBy;

import ru.yandex.qatools.htmlelements.annotations.Name;
import ru.yandex.qatools.htmlelements.element.HtmlElement;
import ru.yandex.qatools.htmlelements.element.Select;
import ru.yandex.qatools.htmlelements.element.TextInput;

@Name("Дополнительная информация по РПО")
public class AdvancedInformationRPOBlock extends HtmlElement {

	@FindBy(name = "weight")
	private TextInput weight;

	@FindBy(name = "val")
	private TextInput val;

	@FindBy(name = "payment")
	private TextInput payment;

	@FindBy(name = "shipRate")
	private TextInput shipRate;

	@FindBy(name = "insuranceRate")
	private TextInput insuranceRate;

	@FindBy(name = "additionalRate")
	private TextInput additionalRate;

	@FindBy(name = "adValTax")
	private TextInput adValTax;

	@FindBy(name = "countryToID")
	private Select countryToID;

	@FindBy(name = "indexTo")
	private TextInput indexTo;

	@FindBy(name = "countryFromID")
	private Select countryFromID;

	@FindBy(name = "indexFrom")
	private TextInput indexFrom;

	@FindBy(name = "clientCtgID")
	private Select clientCtgID;

	@FindBy(name = "mailRankID")
	private Select mailRankID;

	@FindBy(name = "postMarkID")
	private Select postMarkID;

	@FindBy(name = "payTypeID")
	private Select payTypeID;

	public AdvancedInformationRPOBlock setWeight(String text) {
		if (text == null) {
			return this;
		}
		weight.sendKeys(text);
		return this;
	}

	public AdvancedInformationRPOBlock setVal(String text) {
		if (text == null) {
			return this;
		}
		val.sendKeys(text);
		return this;
	}

	public AdvancedInformationRPOBlock setPayment(String text) {
		if (text == null) {
			return this;
		}
		payment.sendKeys(text);
		return this;
	}

	public AdvancedInformationRPOBlock setShipRate(String text) {
		if (text == null) {
			return this;
		}
		shipRate.sendKeys(text);
		return this;
	}

	public AdvancedInformationRPOBlock setInsuranceRate(String text) {
		if (text == null) {
			return this;
		}
		insuranceRate.sendKeys(text);
		return this;
	}

	public AdvancedInformationRPOBlock setAdditionalRate(String text) {
		if (text == null) {
			return this;
		}
		additionalRate.sendKeys(text);
		return this;
	}

	public AdvancedInformationRPOBlock setAdValTax(String text) {
		if (text == null) {
			return this;
		}
		adValTax.sendKeys(text);
		return this;
	}

	public AdvancedInformationRPOBlock setCountryToID(String text) {
		if (text == null) {
			return this;
		}
		countryToID.selectByVisibleText(text);
		return this;
	}

	public AdvancedInformationRPOBlock setIndexTo(String text) {
		if (text == null) {
			return this;
		}
		indexTo.sendKeys(text);
		return this;
	}

	public AdvancedInformationRPOBlock setCountryFromID(String text) {
		if (text == null) {
			return this;
		}
		countryFromID.selectByVisibleText(text);
		return this;
	}

	public AdvancedInformationRPOBlock setIndexFrom(String text) {
		if (text == null) {
			return this;
		}
		indexFrom.sendKeys(text);
		return this;
	}

	public AdvancedInformationRPOBlock setClientCtgID(String text) {
		if (text == null) {
			return this;
		}
		clientCtgID.selectByVisibleText(text);
		return this;
	}

	public AdvancedInformationRPOBlock setMailRankID(String text) {
		if (text == null) {
			return this;
		}
		mailRankID.selectByVisibleText(text);
		return this;
	}

	public AdvancedInformationRPOBlock setPostMarkID(String text) {
		if (text == null) {
			return this;
		}
		postMarkID.selectByVisibleText(text);
		return this;
	}

	public AdvancedInformationRPOBlock setPayTypeID(String text) {
		if (text == null) {
			return this;
		}
		payTypeID.selectByVisibleText(text);
		return this;
	}

	public String getWeight() {
		return weight.getText();
	}

	public String getVal() {
		return val.getText();
	}

	public String getPayment() {
		return payment.getText();
	}

	public String getShipRate() {
		return shipRate.getText();
	}

	public String getInsuranceRate() {
		return insuranceRate.getText();
	}

	public String getAdditionalRate() {
		return additionalRate.getText();
	}

	public String getAdValTax() {
		return adValTax.getText();
	}

	public String getCountryToID() {
		return countryToID.getFirstSelectedOption().getText();
	}

	public String getIndexTo() {
		return indexTo.getText();
	}

	public String getCountryFromID() {
		return countryFromID.getFirstSelectedOption().getText();
	}

	public String getIndexFrom() {
		return indexFrom.getText();
	}

	public String getClientCtgID() {
		return clientCtgID.getFirstSelectedOption().getText();
	}

	public String getMailRankID() {
		return mailRankID.getFirstSelectedOption().getText();
	}

	public String getPostMarkID() {
		return postMarkID.getFirstSelectedOption().getText();
	}

	public String getPayTypeID() {
		return payTypeID.getFirstSelectedOption().getText();
	}

}
